<%@ page contentType="text/html;charset=UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>客户信息</title>
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/import.jsp" %>
<link rel="stylesheet" id="easyuicssId" type="text/css" href="${ctx}/js/easyui/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/js/easyui/themes/demo.css">
	<script type="text/javascript" src="${ctx}/js/zbxtools.js"></script>

<script type="text/javascript">
	var url = "${ctx}/crm/save.action";
	$(function() {
		$('#myForm').form({
			url : url,
			onSubmit : function() {
				return $(this).form('validate');
			},
			success : function(data) {
				var oTxt = jQuery.parseJSON(data);
				var message = oTxt.msg;
				var sucessflag = oTxt.flag;
				if (sucessflag == 'T') {
					$.messager.alert('提示', message, 'info', function() {
						cancel();
						window.parent.reload();
					});
				} else {
					$.messager.alert('提交结果', message, 'error');
				}
			}
		});
	});

	function doSubmit() {//提交按钮
		/*
		var gz=$("input:radio[name='customerIsGz']:checked").val();
		if(gz=='T'){
			var mgrType=$("input[name='mgrType']:checked").val();
		    if(mgrType==null || mgrType==''){
				$.messager.alert('错误', '请填写<font color="red">国资监管机构</font>', 'error');
					return ;
			}
		}*/
		
		var uctUserename = $("#uctUserename").val();
		if(uctUserename==null || uctUserename==''){
			$.messager.alert('错误', '请选择<font color="red">登录用户</font>', 'error');
					return ;
		}
		var customerName = $("#customerName").val();
		if(customerName==null || customerName==''){
			$.messager.alert('错误', '请填写<font color="red">客户名称</font>', 'error');
					return ;
		}
		
		var customerProvince=$('#customerProvince').combobox('getValue');
		 var customerCity=$('#customerCity').combobox('getValue');
		 //if(customerProvince==null||customerProvince==''||customerCity==null||customerCity==''){
		 if(customerProvince==null||customerProvince==''){
		 		$.messager.alert('错误', '请选择所在地区!', 'error');
					return ;
		 }
		var customerF=$("input:radio[name='customerType']:checked").val();
		if(customerF=='A11001'){
		     var customerAddress=$("#customerAddress").val();
		     if(customerAddress==null || customerAddress==''){
				$.messager.alert('错误', '请填写<font color="red">注册地</font>', 'error');
					return ;
			}
		     var customerFunding=$("#customerFunding").val();
		     if(customerFunding==null || customerFunding==''){
				$.messager.alert('错误', '请填写<font color="red">注册资本</font>', 'error');
					return ;
			}
		     var customerTime=$("#customerTime").datebox('getValue');
		     if(customerTime==null || customerTime==''){
				$.messager.alert('错误', '请填写<font color="red">成立时间</font>', 'error');
					return ;
			}
		     var customerBoss=$("#customerBoss").val();
		     if(customerBoss==null || customerBoss==''){
				$.messager.alert('错误', '请填写<font color="red">法定代表人/负责人</font>', 'error');
					return ;
			}
		     var customerIndustry=$("input[name='customerIndustry']").val();
		     if(customerIndustry==null || customerIndustry==''){
				$.messager.alert('错误', '请填写<font color="red">所属行业</font>', 'error');
					return ;
			}
		     var customerUniGslx=$("input[name='customerUniGslx']").val();
		     if(customerUniGslx==null || customerUniGslx==''){
				$.messager.alert('错误', '请填写<font color="red">公司类型（经济性质）</font>', 'error');
					return ;
			}
		     var customerUniJjlx=$("input[name='customerUniJjlx']").val();
		     if(customerUniJjlx==null || customerUniJjlx==''){
				$.messager.alert('错误', '请填写<font color="red">经济类型</font>', 'error');
					return ;
			}
// 		     var customerZcode=$("#customerZcode").val();
// 		     if(customerZcode==null || customerZcode==''){
// 				$.messager.alert('错误', '请填写<font color="red">组织机构代码</font>', 'error');
// 					return ;
// 			}
		//2015-02-01 add by fdong start
		}else if(customerF=='A11002'){
			//var certificateName=$("#certificateName").val();
			var certificateName=$("input[name='certificateName']").val();
		     if(certificateName==null || certificateName==''){
				$.messager.alert('错误', '请填写<font color="red">证件名称</font>', 'error');
					return ;
			}
		}
		 /**/
		//2015-02-01 add by fdong end
		if ($("#myForm").form('validate')) {
			if(!window.confirm("您确认提交此操作吗？"))return;
			$('#myForm').submit();
		}
	}

	function clickFaren() {
		$('#customer_base1').css('display', 'block');
		$('#customer_base2').css('display', 'none');
		$('#cerTR').show();

	}

	function clickZiranren() {
		$('#customer_base2').css('display', 'block');
		$('#customer_base1').css('display', 'none');
		$('#cerTR').hide();

	}

	function showDj() {
		if ($("input:radio[name='mgrType']:checked").val() == 'A02005') {
			document.getElementById("dj01").style.display = 'block';
			document.getElementById("dj02").style.display = 'none';
		} else {
			document.getElementById("dj01").style.display = 'none';
			document.getElementById("dj02").style.display = 'block';
		}

	}
	function hideDj() {
		document.getElementById("dj01").style.display = 'none';
		document.getElementById("dj02").style.display = 'none';
		$("input:radio[name='spare1']:checked").attr("checked",false);
	}

	function clickGz() {
		var gz = $("input:radio[name='customerIsGz']:checked").val();
		if (gz == 'F') {
			$("#jg").css('display', 'none');
			$("input:radio[name='customerType'][value='A11002']").attr(
					"disabled", false);
		} else {
			$("#jg").css('display', 'block');
			$("input:radio[name='customerType'][value='A11002']").attr(
					"disabled", "disabled");
			$("input:radio[name='customerIsYq'][value='T']").attr("checked",
					true);
			$("#customerTypeFr").attr("checked",true);
			clickFaren();

		}

	}

	//取消
	function cancel() {
		window.parent.closeWin();
	}

	$(function() {
		var isGz = '${item.customerIsGz}';
		var ctype = '${item.customerType}';
		if(isGz == 'F'){
			$("#customerIsGzN").attr("checked",true);
		}else{
			$("#customerIsGzY").attr("checked",true);
		}
		
		if(ctype == 'A11002'){
			$("#customerTypeZzr").attr("checked",true);
		}else{
			$("#customerTypeFr").attr("checked",true);
		}
		
		clickGz();
		if (ctype != 'A11002') {
			clickFaren();
		} else {
			clickZiranren();
		}
		
		var isadd = '${isAdd}';
		if(isadd != 'true'){
			$("#customerIsGzN").attr("disabled",true);
			$("#customerIsGzY").attr("disabled",true);
			$("#customerTypeZzr").attr("disabled",true);
			$("#customerTypeFr").attr("disabled",true);		
		}
	});
	
	function selectUser(){
		
		var widthcount = $(document.body).width()-20;
		var leftcount = document.documentElement.scrollLeft;
		$('#userAddFrame').html('');
		var url = '${ctx}/crm/user.action';
		$('#userAddFrame').attr("src",url);
		$('#userAddWin').css({"width":widthcount,"height":"450px","left":leftcount});
		//$('#userAddWin').window('setTitle',"客户信息");
		$('#userAddWin').panel('setTitle','选择用户');
		$('#userAddWin').window('open');
	}
	
	function closeSelectUser(){
			$('#userAddWin').window('close');
		}
		
	function setIdAndName(id,name){
		$('#customerId').val(id);
		$('#uctUserename').val(name);
	}
</script>
</head>
<body>
		<form id="myForm" name="myForm" method="post">
			<input type="hidden" name="isAdd" value="${isAdd }" />
			<input type="hidden" name="isAudit" value="${isAudit }" />
			<input type="hidden" name="customerId" id="customerId" value="${item.customerId }" />
			<input type="hidden" name="customerNo" id="customerNo" value="${item.customerNo }" />
			<c:if test='${"true" !=isAdd}'>
			<input type="hidden" name="uctUserename" id="uctUserename" value="${item.uctUserename }" />
			</c:if> 
			<br />
			<table align="center" cellspacing=1 cellpadding=0 class="info">
				<c:if test='${"true" ==isAdd}'>
					<tr>
						<th width="160"> 登录用户</th>
						<td colspan="3">
							<input type="input" name="uctUserename" id="uctUserename" value="" readonly="readonly"/><a href="javascript:void(0);" onclick="selectUser();">选择用户</a>
						</td>
					</tr>
				</c:if>
				<tr>
					<th width="160">类型</th>
					<td>请选择是否国资 
					    <input type="radio" id="customerIsGzY" name=customerIsGz value="T" onclick="clickGz();" checked />国资 
					    <input type="radio" id="customerIsGzN" name=customerIsGz value="F" onclick="clickGz();" />非国资
					</td>
					<td><span id="zrr" style="display:block"> 
					   <input type="radio" id="customerTypeFr" name="customerType" value="A11001" onclick="clickFaren();" checked />法人(其它组织) 
					   <input type="radio" id="customerTypeZzr" name="customerType" value="A11002" onclick="clickZiranren();" />自然人 
					</span></td>
				</tr>
			</table>
			<br/>
			<!--<table id="jg" class="datagrid-body">
				<tr>
					<th rowspan=4 width="67">监管</th>
					<td width=199>国资监管类型</td>
					<td colspan=5><input type=radio name=customerIsYq value="T" />央企
						<input type=radio name=customerIsYq checked value="F" />非央企</td>
				</tr>
				<tr>
					<td width=199>国资监管机构</td>

					<td colspan="5" class=aleft>
						<div id=jgjg1 style="display:block;text-align:left;">
							<input type=radio name=mgrType value="A02001" onclick="hideDj();" <c:if test='${"A02001" ==item.mgrType}'>checked</c:if>/>国务院国资委监管 
							<input type=radio name=mgrType value="A02002" onclick="hideDj();" <c:if test='${"A02002" ==item.mgrType}'>checked</c:if>/>其他中央部委监管
						</div>
						<div id=jgjg2 style="display:block;text-align:left; margin-left:30px;">
							<input type=radio name=mgrType value="A02003" onclick="hideDj();" <c:if test='${"A02003" ==item.mgrType}'>checked</c:if>/>省（直辖市、自治区)级国资委监管<br />
							<input type=radio name=mgrType value="A02004" onclick="hideDj();" <c:if test='${"A02004" ==item.mgrType}'>checked</c:if>/>省（直辖市、自治区）级其他部门监管<br />
							<input type=radio name=mgrType value="A02005" onclick="showDj();" <c:if test='${"A02005" ==item.mgrType}'>checked</c:if>/>地级市（区县）国资委监管<br />
							<div id="dj01" style="display:none; text-align:left; margin-left:30px;">
								<input type=radio name="spare1" value="A02007" onclick="notGWYJG();" <c:if test='${"A02007" ==item.spare1}'>checked</c:if>/>地级市国资委监管<br> 
								<input type=radio name="spare1" value="A02008" onclick="notGWYJG();" <c:if test='${"A02008" ==item.spare1}'>checked</c:if>/>区县国资委监管<br>
							</div>
							<input type=radio name=mgrType value="A02006" onclick="showDj();" <c:if test='${"A02006" ==item.mgrType}'>checked</c:if>/>地级市（区县）其他部门监管<br />
							<div id="dj02" style="display:none; text-align:left; margin-left:30px;">
								<input type=radio name="spare1" value="A02009" onclick="notGWYJG();sdm();" <c:if test='${"A02009" ==item.spare1}'>checked</c:if>/>地级市其他部门监管<br> 
								<input type=radio name="spare1" value="A02010" onclick="notGWYJG();sdm();" <c:if test='${"A02010" ==item.spare1}'>checked</c:if>/>区县其他部门监管<br>
							</div>
							<input type=radio value="0" name=mgrType onclick="hideDj();" <c:if test='${"0" ==item.mgrType}'>checked</c:if>/>无监管机构<br />
							国资监管机构地区代码: <select id="mgrProvince" name="mgrProvince"
								required="false" class="easyui-validatebox" style="width:150px;">
							</select> 
							<select id="mgrCity" name="mgrCity" required="false" class="easyui-validatebox" style="width:150px;">
							</select> 
							<input type=text value="0000" name="mgrArea" id="mgrArea" readonly="true" />
						</div></td>
				</tr>
				<tr>
					<td width=199>主管集团或其他部门名称</td>
					<td colspan="5"><input name="mgrName" id="mgrName"
						type="text" size="28" class="easyui-validatebox"
						validType="length[1,60]" value="${item.mgrName }" /> 
					</td>
				</tr>
				<tr>
					<td width=199>主管集团或其他部门组织机构代码</td>
					<td colspan="5"><input name="mgrCode" id="mgrCode"
						type="text" size="28" class="easyui-validatebox"
						validType="length[1,15]" value="${item.mgrCode }" />
						<--说明：若“主管集团或其他部门名称”数据字典读取，则机构代码自动关联显示。-=-></td>
				</tr>
			</table>-->

						<table align="center"  cellspacing=1 cellpadding="0" class="info">
							<tr>
								<th width="160">客户名称</th>
								<td colspan="3">
								<input type=text id="customerName" maxlength="100" name="customerName" value="${item.customerName }" size='60'
									required="false" class="easyui-validatebox" validType="length[1,100]" /></td>
							</tr>
							<tr>
								<th>所在地区</th>
								<td colspan="3">
								<select id="customerProvince" name="customerProvince" style="width:150px;"></select> 
								<select id="customerCity" name="customerCity" style="width:150px;"></select>
								</td>
							</tr>
						</table>
						<br/>
						<div id="customer_base1" style="display:block" class="info">
							<table cellpadding="0" cellspacing="1" class=info>
								<tr>
									<th width="160">注册地</th>
									<td><input id="customerAddress" maxlength="100" name="customerAddress"
										type="text" size="24" value="${item.customerAddress }"
										class="easyui-validatebox" validType="length[1,300]" />
									</td>
									<th width="160">注册资本（万元）</th>
									<td><input type="text" id="customerFunding"
										name="customerFunding" size="24" maxlength="10"
										value="${item.customerFunding }" class="easyui-validatebox"
										validType="length[1,15]" /> <!--币种<select id="moneyType"
										name="moneyType" style="width:70px;"></select>--></td>
								</tr>
								<tr>
									<th>成立时间</th>
									<td><input type="text" size="24" id="customerTime"
										name="customerTime" class="easyui-datebox"
										value="${item.customerTime}" class="easyui-validatebox"
										validType="length[1,15]">
									</td>
									<th>法定代表人/负责人</th>
									<td><input type="text" id="customerBoss" maxlength="50"
										name="customerBoss" size="24" class="easyui-validatebox"
										validType="length[1,15]" value="${item.customerBoss}" />
									</td>
								</tr>
								<tr>
									<th>所属行业</th>
									<td><input id="customerIndustry" name="customerIndustry"
										class="easyui-combotree"
										url="${ctx}/dict/pub/dict-tree.action?cateEname=industry&value=${itme.customerIndustry}"
										style="width:150px;"></td>
									<th>企业类型（经济性质）</th>
									<td><select id="customerUniGslx" name="customerUniGslx"
										required="false" class="easyui-validatebox"
										style="width:150px;"></select>
									</td>
								</tr>
								<tr>
									<th>经济类型</th>
									<td colspan="3"><p>
										<select id="customerUniJjlx" name="customerUniJjlx" style="width:150px;"></select>
										</p>
									</td>
								</tr>
								<tr>
									<th>经营规模</th>
									<td colspan="3"><input type="radio" name="customerScale"
										value="1"
										<c:if test="${item.customerScale == 1}">checked</c:if> />大 <input
										type="radio" name="customerScale" value="2"
										<c:if test="${item.customerScale == 2}">checked</c:if> />中 <input
										type="radio" name="customerScale" value="3"
										<c:if test="${item.customerScale == 3}">checked</c:if> />小 <input
										type="radio" name="customerScale" value="4"
										<c:if test="${item.customerScale == 4}">checked</c:if> />未知</td>
								</tr>
<!-- 								<tr> -->
<!-- 									<td>组织机构代码</td> -->
<!-- 									<td colspan="3"><input type="text" id="customerZcode" -->
<!-- 										name="customerZcode" value="${item.customerZcode }" size="24" -->
<!-- 										class="easyui-validatebox" validType="length[1,15]" /> -->
<!-- 										无法提供时请录入000000000</td> -->
<!-- 								</tr> -->
<!-- 								<tr> -->
<!-- 									<td>工商注册码</td> -->
<!-- 									<td colspan="3"><input type="text" id="customerGszcm" -->
<!-- 										name="customerGszcm" size="24" class="easyui-validatebox" -->
<!-- 										validType="length[1,15]" value="${item.customerGszcm }" /></td> -->
<!-- 								</tr> -->
<!-- 								<tr> -->
<!-- 									<td>经营范围</td> -->
<!-- 									<td colspan="3"><input type="text" id="customerScope" -->
<!-- 										name="customerScope" size="103" class="easyui-validatebox" -->
<!-- 										validType="length[1,1000]" value="${item.customerScope }" /> -->
<!-- 									</td> -->
<!-- 								</tr> -->

							</table>
						</div>
						<div id="customer_base2" style="display:none" class="info">
							<table align="center" cellspacing=1 cellpadding=0 class="info">
								<tr>
									<!--20150204 add by fdong start  -->
									<th width="160">证件名称</th>
									<!--20150204 add by fdong end  -->
									<td>
									<!--<input type="text" id="certificateName" maxlength="50"
										name="certificateName" value="${item.certificateName }"
										size="30" class="easyui-validatebox" validType="length[1,60]" />-->
										<select id="certificateName" name="certificateName" style="width:150px;"></select>
									</td>
									<th width="160">证件号码</th>
									<td><input type="text" id="certificateNo" maxlength="20"
										name="certificateNo" value="${item.certificateNo }" size="30"
										class="easyui-validatebox" validType="length[1,60]" />
									</td>
								</tr>
								<tr>
									<th>工作单位</th>
									<td><input type="text" id="company" name="company" maxlength="50"
										size="30" value="${item.company }" class="easyui-validatebox"
										validType="length[1,60]" />
									</td>
									<th>职务</th>
									<td><input type="text" id="position" name="position" maxlength="50"
										size="30" value="${item.position }" class="easyui-validatebox"
										validType="length[1,60]" />
									</td>
								</tr>
							</table>
							</div>
			<br/>
			<table align="center" cellspacing=1 border="0" cellpadding="0" class="info">
			<tr>
					<th width="160">联系人姓名</th>
					<td>
						<input type="text" id="contactName" size="24" maxlength="15" name="contactName" value="${item.contactName }"
						class="easyui-validatebox" validType="length[1,15]" />
					</td>
					<th width="160">联系人电话</th>
					<td><input type="text" id="contactPhone" maxlength="15" size="24" name="contactPhone" value="${item.contactPhone }"
						class="easyui-numberbox" />
					</td>
				</tr>
				<tr>
					<th>联系人邮件</th>
					<td><input type="text" id="contactEmail" size="24" maxlength="30"
						name="contactEmail" value="${item.contactEmail }"
						class="easyui-validatebox" validType="email" />
					</td>
					<th>联系人传真</th>
					<td><input type="text" id="contactFax" size="24" maxlength="20"
						name="contactFax" value="${item.contactFax }"
						class="easyui-validatebox" validType="faxno" />
					</td>
				</tr>
				<tr id="cerTR">
<!-- 					<th>资信证明</th> -->
					<th>主体资格证明</th>
					<td colspan='3'><input type="text" id="creditCer" maxlength="100" name="creditCer" value="${item.creditCer }" size="60"
						class="easyui-validatebox" validType="length[1,300]" />
					</td>
				</tr>
			</table>
			<center>
				<c:if test='${"true" ==isAudit}'>
				<input type="hidden" name="auditState" id="auditState" value="1" />
				<a class="easyui-linkbutton" id="saveYes" iconCls="icon-add"
					onClick="doSubmit();">确认激活</a>
				</c:if>
				<c:if test='${"true" != isAudit}'>
				<a class="easyui-linkbutton" id="saveYes" iconCls="icon-add"
					onClick="doSubmit();">保存</a>
				</c:if>
			</center>

		</form>
		<div id="userAddWin" class="easyui-window" title="客户信息" style="padding:5px;float:left;top:10px;" iconCls="icon-search" closed="true" minimizable="false" maximizable="false" maximized="true" collapsible="false">
   	 	<iframe frameborder="0"  id="userAddFrame" height="100%" width="100%" scrolling="Yes" frameborder="0" ></iframe>
    </div>

	<script>
		//是否是国资
		var customerIsGz = "T"; //缺省T
		if ("" != null && "" != "") {
			customerIsGz = "";
		}

		//央企 非央企
		var customerIsYq = "F"; //缺省N

		if ("" != null && "" != "") {
			customerIsYq = "";
		}

		//法人 自然人
		var customerType = "法人"; //缺省法人
		if ("" != null && "" != "") {
			customerType = "";
		}

		//监管机构类型
		var mgrType = "A02003";//缺省0
		if ("" != null && "" != "") {
			mgrType = "";
		}

		function delayOnload() {
			initRadio('customerIsGzY', customerIsGz);
			initRadio('customerIsYq', customerIsYq);
			initRadio('customerType', customerType);
			initRadio('customerScale', "");

			$("#wantBuyUnit").val(wantBuyUnit);
			$("#mgrName").val("");
			$("#mgrCode").val("");
			$("#mgrArea").val("");

			$("#customerName").val("");
			$("#customerBoss").val("");

			$("#contactName").val("");
			$("#contactPhone").val("");
			$("#contactEmail").val("");
			$("#contactFax").val("");
			$("#creditCer").val("");

			$("#certificateName").val("");
			$("#certificateNo").val("");
			$("#company").val("");
			$("#position").val("");
			$("#assetApplyDesc").val("");

		}

		//------------------------------------------数据字典中动态加载数据----------------------------------------------------------------		
		//央企
		var Qlist = '${ctx}/dict/pub/dict-select.action?cateEname=yqlist';
		if (customerIsYq == 'T') {
			Qlist = '${ctx}/dict/pub/dict-select.action?cateEname=yqlist';
		} else {
			Qlist = '${ctx}/dict/pub/dict-select.action?cateEname=sqlist';
		}
		//央企
		$('#YQlist').combobox({
			width : 160,
			url : Qlist,
			valueField : 'id',
			textField : 'text',
			onSelect : function() {
				var tmpv = $('#YQlist').combobox('getValue');
				var tmpn = $('#YQlist').combobox('getText');
				$('#mgrName').val(tmpn);
				$('#mgrCode').val(tmpv);
			}
		});

		$('#mgrCity').combobox({
			url : '${ctx}/dict/pub/dict-select.action?cateEname=area&fatherValue=',
			valueField : 'id',
			textField : 'text',
			onChange : function() {
				var tmpv = $('#mgrCity').combobox('getValue');
				if (tmpv != '') {
					$('#mgrArea').val(tmpv);
				} else {
					var provinceTmp = $('#mgrProvince').combobox('getValue');
					$('#mgrArea').val(provinceTmp);
				}
            }
		});
		$('#mgrProvince').combobox({
			url : '${ctx}/dict/pub/dict-select.action?cateEname=area&fatherValue=0',
			valueField : 'id',
			textField : 'text',
			onChange : function() {
				var provinceTmp = $('#mgrProvince').combobox('getValue');
				$('#mgrArea').val(provinceTmp);
				var cityUrlTmp = '${ctx}/dict/pub/dict-select.action?cateEname=area&fatherValue='+ provinceTmp;
				$('#mgrCity').combobox('clear');
				$('#mgrCity').combobox('reload', cityUrlTmp);
			}
		});
		//////////////////////////////
		var dictProvId = 'customerProvince';//省份的下拉列表id
		var dictCityId = 'customerCity';//城市的下拉列表id	
		var webCtx = '${ctx}';
		function loadCity(provinceValue) {
			var cityUrl = webCtx+ '/dict/pub/dict-select.action?cateEname=area&fatherValue='+ provinceValue;
			$('#' + dictCityId).combobox({
				url : cityUrl,
				valueField : 'id',
				editable : false,
				textField : 'text'
			});
		}

		function loadProvince() {
			$('#' + dictProvId).combobox({
				url : webCtx+ '/dict/pub/dict-select.action?cateEname=area&fatherValue=0',
				valueField : 'id',
				editable : false,
				textField : 'text',
				onChange : function() {
				    var provinceTmp = $('#' + dictProvId).combobox('getValue');
					loadCity(provinceTmp);
				}
			});
		}

		function loadSelect(paraSelectId, paraCateEname) {
			var myUrl = webCtx + '/dict/pub/dict-select.action?cateEname='+ paraCateEname;
			$('#' + paraSelectId).combobox({
				url : myUrl,
				valueField : 'id',
				editable : false,
				textField : 'text'
			});
		}

		
		loadProvince();
		loadCity('');
		loadSelect('customerUniGslx', 'gslx');
		loadSelect('customerUniJjlx', 'sellerjjlx');
		loadSelect('certificateName', 'pCertifType');
		//loadFirstDictJson('pCertifType','certificateName','${ctx}','');		

		//loadSelect('moneyType', 'moneytype');
		//loadSelect('zcMoneyType', 'moneytype');

		$(function() {
			$('#customerIndustry').combotree('setValue', '${item.customerIndustry}');
			$('#customerUniGslx').combobox('setValue','${item.customerUniGslx}');
			$('#customerUniJjlx').combobox('setValue','${item.customerUniJjlx}');
			$('#certificateName').combobox('setValue','${item.certificateName}');
// 			$('#moneyType').combobox('setValue','${item.moneyType}');
			$('#customerProvince').combobox('setValue','${item.customerProvince}');
			$('#customerCity').combobox('setValue','${item.customerCity}');
			$('#mgrProvince').combobox('setValue','${item.mgrProvince}');
			$('#mgrCity').combobox('setValue','${item.mgrCity}');
			//setSelectValue('zcMoneyType', '');

			
			$('#mgrProvince').combobox('setValue','${item.mgrProvince}');
			$('#mgrCity').combobox('setValue','${item.mgrCity}');

			if ('${item.mgrType}' == 'A02007' || '${item.mgrType}' == 'A02008') {
				document.getElementById("dj01").style.display = 'block';
				document.getElementById("dj02").style.display = 'none';
			} else if ('${item.mgrType}' == 'A02009' || '${item.mgrType}' == 'A02010') {
				document.getElementById("dj01").style.display = 'none';
				document.getElementById("dj02").style.display = 'block';
			}
			$('#mgrProvince').combobox('setValue','${item.mgrProvince}');
		});

		function isYQ() {
			document.getElementById('jgjg1').style.display = 'block';
			document.getElementById('jgjg2').style.display = 'none';
			document.getElementsByName('mgrType')[0].checked = "true";
			document.getElementById('YQlist').readOnly = false;
			document.getElementById('mgrName').readOnly = true;
			document.getElementById('mgrCode').readOnly = true;
			document.getElementById('mgrName').value = "请从企业名单中选择";
			document.getElementById('mgrCode').value = "0000";
			var Qlist = '/dict/pub/dict-select.action?cateEname=yqlist';
			$('#YQlist').combobox('clear');
			$('#YQlist').combobox('reload', Qlist);
		}

		function notYQ() {
			document.getElementById('jgjg1').style.display = 'none';
			document.getElementById('jgjg2').style.display = 'block';
			document.getElementsByName('mgrType')[2].checked = "true";
			document.getElementById('YQlist').readOnly = true;
			document.getElementById('mgrName').readOnly = false;
			document.getElementById('mgrCode').readOnly = false;
			var Qlist = '/dict/pub/dict-select.action?cateEname=sqlist';
			$('#YQlist').combobox('clear');
			$('#YQlist').combobox('reload', Qlist);

		}
		function GWYJG() {
			document.getElementById('mgrName').readOnly = true;
			document.getElementById('mgrCode').readOnly = true;
			document.getElementById('mgrName').value = "请从央企名单中选择";
			document.getElementById('mgrCode').value = "0000";
			document.getElementById('YQlist').readOnly = false;
		}

		function notGWYJG() {
			document.getElementById('mgrName').readOnly = false;
			document.getElementById('mgrCode').readOnly = false;
// 			document.getElementById('mgrName').value = "输入主管机构名称";
// 			document.getElementById('mgrCode').value = "输入主管机构代码";
			document.getElementById('YQlist').readOnly = true;
		}

		function pdm() {
			document.getElementById('mgrArea').value = "0000";
			document.getElementById('mgrCity').readOnly = true;
			var Qlist = '/dict/pub/dict-select.action?cateEname=sqlist';
			$('#YQlist').combobox('clear');
			$('#YQlist').combobox('reload', Qlist);

		}
		function sdm() {
			document.getElementById('mgrArea').value = "0000";
			document.getElementById('mgrCity').readOnly = false;
			var Qlist = '/dict/pub/dict-select.action?cateEname=siqlist';
			$('#YQlist').combobox('clear');
			$('#YQlist').combobox('reload', Qlist);
		}
	</script>


</body>
</html>
